package com.xy.gateway.cert;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.xy.gateway.exception.GateWayException;
import com.xy.gateway.model.Providercert;
import com.xy.gateway.request.pay.handle.RequestParaHandler;

public class CertManagerCEB extends CertManagerAbstrace {
	public boolean verifyResSignData() throws GateWayException {
		String Plain = req.getParameter("Plain");
		String Signature = req.getParameter("Signature");
		boolean r = com.csii.payment.client.core.CebMerchantSignVerify
				.merchantVerifyPayGate_ABA(Signature, Plain);
		return r;
	}

	@Override
	public String genReqSignData() throws GateWayException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void addReqSignDate(Map<String, String> reqMap)
			throws GateWayException {
		String plain = genReqSignSourcedata();
		String sign = com.csii.payment.client.core.CebMerchantSignVerify
				.merchantSignData_ABA(plain);
		reqMap.clear();
		reqMap.put("Plain", plain);
		reqMap.put("Signature", sign);

	}

	public CertManagerCEB(Providercert providercert, String sid,
			RequestParaHandler requestParaHandler, HttpServletRequest req,
			String paytype, String reqtype) {
		super(providercert, sid, requestParaHandler, req, paytype, reqtype);
	}
	protected String getSignDataPrefix(String parameterName) {
		return parameterName+"=";
	}
}
